import axios from 'axios'
import base from "./base"

const api = {
    /*登录注册相关*/
    //手机号是否注册过
    isPhoneRegistered(params) {
        return axios.get(base.baseUrl + base.isPhoneRegistered, { params });
    },
    //获取验证码
    getAuthCode(params) {
        return axios.post(base.baseUrl + base.getAuthCode, params);
    },
    //注册
    register(params) {
        return axios.post(base.baseUrl + base.register, params);
    },
    //用户名是否注册过
    isNameRegistered(params) {
        return axios.get(base.baseUrl + base.isNameRegistered, { params });
    },
    //密码登录
    tryLogin(params) {
        return axios.post(base.baseUrl + base.tryLogin, params);
    },
    //短信登录
    login(params) {
        return axios.post(base.baseUrl + base.login, params)
    },
    //修改密码
    resetPswd(params) {
        return axios.post(base.baseUrl + base.resetPswd, params)
    },
    changePhoneNumber(params) {
        return axios.post(base.baseUrl + base.changePhoneNumber, params)
    },
    /*个人信息*/
    //个人信息
    getPersonalInfo(params) {
        return axios.post(base.baseUrl + base.getPersonalInfo, params)
    },
    //修改昵称
    chNickname(params) {
        return axios.post(base.baseUrl + base.chNickname, params)
    },
    //修改头像
    chImage(params) {
        return axios.post(base.baseUrl + base.chImage, params)
    },
    //修改基本信息
    chBasicInfo(params) {
        return axios.post(base.baseUrl + base.chBasicInfo, params)
    },
    //修改教育信息
    chEduInfo(params) {
        return axios.post(base.baseUrl + base.chEduInfo, params)
    },
    /*收货信息 */
    //获取收货信息
    getGoodsReceiveInfo(params) {
        return axios.post(base.baseUrl + base.getGoodsReceiveInfo, params)
    },
    //修改收货信息
    chGoodsReceiveInfo(params) {
        return axios.post(base.baseUrl + base.chGoodsReceiveInfo, params)
    },
    //新增地址
    addGoodsReceiveInfo(params) {
        return axios.post(base.baseUrl + base.addGoodsReceiveInfo, params)
    },
    //删除地址
    delGoodsReceiveInfo(params) {
        return axios.post(base.baseUrl + base.delGoodsReceiveInfo, params)
    },
    /*聊天相关 */
    //获取聊天列表
    getChatList(params) {
        return axios.get(base.baseUrl + base.getChatList, { params })
    },
    //获取聊天信息
    getMesgs(params) {
        return axios.post(base.baseUrl + base.getMesgs, params)
    },
    sendText(params) {
        return axios.post(base.baseUrl + base.sendText, params)
    },
    /*评论相关*/
    //获取评论列表
    getGoodComments(params) {
        return axios.get(base.baseUrl + base.getGoodComments, { params })
    },
    //发表评论
    addAComment(params) {
        return axios.get(base.baseUrl + base.addAComment, { params })
    },
    //删除评论
    delAComment(params) {
        return axios.get(base.baseUrl + base.delAComment, { params })
    },
    //举报评论
    reportComment(params) {
        return axios.get(base.baseUrl + base.reportComment, { params })
    },

    //获取商品类别
    getAllCategories(params) {
        return axios.get(base.baseUrl + base.getAllCategories, { params })
    },

    /*商品相关 */
    //获取商品详情
    getGoodDetail(params) {
        return axios.get(base.baseUrl + base.getGoodDetail, { params })
    },
    //举报商品
    reportGood(params) {
        return axios.post(base.baseUrl + base.reportGood, params)
    },

    /*购买流程相关 */
    //提交订单
    submitOrder(params) {
        return axios.post(base.baseUrl + base.submitOrder, params)
    },
    //获取订单商品详情
    getCreateOrdersInfo(params) {
        return axios.get(base.baseUrl + base.getCreateOrdersInfo, { params })
    },
    //获取支付链接
    getOrderPayQrCode(params) {
        return axios.post(base.baseUrl + base.getOrderPayQrCode, params)
    },
    //书币支付
    payWithCoin(params) {
        return axios.post(base.baseUrl + base.payWithCoin, params)
    },

    /*通知相关 */
    //获取通知列表
    getNotices(params) {
        return axios.get(base.baseUrl + base.getNotices, { params })
    },
    /*卖家相关 */
    //添加书籍
    addGood(params) {
        return axios.post(base.baseUrl + base.addGood, params)
    },
    //获取我卖的书的详情
    getMyGoodDetail(params) {
        return axios.get(base.baseUrl + base.getMyGoodDetail, { params })
    },
    //修改商品信息
    chGoodInfo(params) {
        return axios.post(base.baseUrl + base.chGoodInfo, params)
    },
    //添加商品详细图片
    addGoodMoreFiles(params) {
        return axios.post(base.baseUrl + base.addGoodMoreFiles, params)
    },
    /* 充值相关*/
    //充值书币
    getBuyCoinQrCode(params) {
        return axios.post(base.baseUrl + base.getBuyCoinQrCode, params)
    },
    //获取流水记录 
    getWalletRecord(params) {
        return axios.post(base.baseUrl + base.getWalletRecord, params)
    },
    //上传提现二维码
    chPaymentCodeUrl(params) {
        return axios.post(base.baseUrl + base.chPaymentCodeUrl, params)
    },
    //提现
    requestWithdrawal(params) {
        return axios.post(base.baseUrl + base.requestWithdrawal, params)
    },

    //退出
    exit(params) {
        return axios.get(base.baseUrl + base.exit, { params });
    },
    dealWithDraw(params) {
        return axios.post(base.baseUrl + base.dealWithDraw, params)
    },
    saveFeedback(params) {
        return axios.post(base.baseUrl + base.feedback, params)
    },
}

export default api;